import http from '@/utils/http'

/** 获取地址列表 */
export function getAddressList() {
  return http({
    url: '/member/address',
    method: 'GET'
  })
}

/** 新增地址 */
export function addAddress(data) {
  return http({
    url: '/member/address',
    method: 'POST',
    data
  })
}

/** 获取地址详情 */
export function getAddressDetail(id) {
  return http({
    url: `/member/address/${id}`,
    method: 'GET'
  })
}

/** 修改地址 */
export function editAddress(id, data) {
  return http({
    url: `/member/address/${id}`,
    method: 'PUT',
    data
  })
}

/** 删除地址 */
export function delAddress(id) {
  return http({
    url: `/member/address/${id}`,
    method: 'DELETE',
  })
}